package com.insurance.common.enums;

import org.apache.commons.lang.StringUtils;

/**
 * 用户证件类型枚举类
 *
 * @version 1.0
 * @date 2020/9/20
 **/
public enum UserCardTypeEnum {

    SHEN_FEN_ZHENG("01", "身份证"),
    JUN_GUAN_ZHENG("02", "军官证"),
    GANG_AO_TONGXING_ZHENG("03", "港澳通行证"),
    TAI_BAO_ZHENG("04", "台胞证"),
    WAI_JI_HU_ZHAO("05", "外籍护照"),
    JIA_SHI_ZHENG("06", "驾驶证");

    private String code;

    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    UserCardTypeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMessage(String code){
        if(!StringUtils.isBlank(code)){
            UserCardTypeEnum[] values = values();
            for(UserCardTypeEnum stateEnum : values){
                if(code.equals(stateEnum.getCode())){
                    return stateEnum.getMsg();
                }
            }
        }
        return "";
    }

}
